#include <iostream>
#include <boost/lexical_cast.hpp>
class A
{
public:
	double x;
};
std::istream& operator>>( std::istream&is, A& a)
{
	is >> std::skipws >> a.x;
	return is;
}
std::ostream& operator<<( std::ostream&os, const A& a)
{
	os << a.x;
	return os;
}int main(int argc, char *argv[])
{
	A a = boost::lexical_cast<A>(std::string("1.23"));
	std::cout << a.x << std::endl;

	a.x = 12.3;
	std::cout << boost::lexical_cast<std::string>(a) << std::endl;

	std::cout << boost::lexical_cast<std::string>(123) << std::endl;	
	std::cout << boost::lexical_cast<int>(1234) << std::endl;
}
